package com.cloud.order.feign.fallback;

import com.cloud.order.feign.ProductFeignClient;
import com.cloud.product.bean.Product;
import org.springframework.stereotype.Component;

import java.math.BigDecimal;

/**
 * @author lx
 * @date 2025/11/27
 * @Description
 */
@Component
public class ProductFeignClientFallback implements ProductFeignClient {
    @Override
    public Product getProduct(Long id, String authorization) {
        System.out.println("fallback--兜底回调");
        Product product = new Product();
        product.setId(id);
        product.setName("商品不存在");
        product.setPrice(new BigDecimal(0));
        return product;
    }
}
